﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace FACUI.BasicClass
{
    public class XHJ : Sharp
    {
        private int i角度;
        private Point pointx;

        public XHJ(MapData mapData, Point pt, int d, string subType)
            : base(mapData, pt, d)
        {
            this.i角度 = 0;
            if (!"8".Equals(subType))
            {
                base.digitList.Add(new Digit("红灯", "XHJ_H", 1));
                base.digitList.Add(new Digit("绿灯1", "XHJ_L", 1));
                base.digitList.Add(new Digit("黄灯1", "XHJ_U", 1));
                base.digitList.Add(new Digit("白灯", "XHJ_B", 1));
                base.digitList.Add(new Digit("蓝灯", "XHJ_A", 1));
                base.digitList.Add(new Digit("绿灯2[双绿]", "XHJ_2L", 1));
                base.digitList.Add(new Digit("黄灯2[双黄]", "XHJ_2U", 1));
                base.digitList.Add(new Digit("黄闪黄", "XHJ_USU", 1));
                base.digitList.Add(new Digit("红闪", "XHJ_HS", 1));
                base.digitList.Add(new Digit("白闪", "XHJ_BS", 1));
                base.digitList.Add(new Digit("绿闪", "XHJ_LS", 1));
                base.digitList.Add(new Digit("黄闪", "XHJ_US", 1));
                base.digitList.Add(new Digit("绿黄", "XHJ_LU", 1));
                base.digitList.Add(new Digit("红白", "XHJ_HB", 1));
                base.digitList.Add(new Digit("关闭", "XHJ_GB", 1));
            }
            else
            {
                base.digitList.Add(new Digit("方向", "XHJ_QDFX", 1));
                base.digitList.Add(new Digit("L6", "XHJ_DPL6", 1));
                base.digitList.Add(new Digit("L5", "XHJ_DPL5", 1));
                base.digitList.Add(new Digit("L4", "XHJ_DPL4", 1));
                base.digitList.Add(new Digit("L3", "XHJ_DPL3", 1));
                base.digitList.Add(new Digit("L2", "XHJ_DPL2", 1));
                base.digitList.Add(new Digit("L", "XHJ_DPL", 1));
                base.digitList.Add(new Digit("LU", "XHJ_DPLU", 1));
                base.digitList.Add(new Digit("LU2", "XHJ_DPLU2", 1));
                base.digitList.Add(new Digit("U", "XHJ_DPU", 1));
                base.digitList.Add(new Digit("U2", "XHJ_DPU2", 1));
                base.digitList.Add(new Digit("U2S", "XHJ_DPU2S", 1));
                base.digitList.Add(new Digit("UU", "XHJ_DPUU", 1));
                base.digitList.Add(new Digit("UUS", "XHJ_DPUUS", 1));
                base.digitList.Add(new Digit("HU", "XHJ_DPHU", 1));
                base.digitList.Add(new Digit("HB", "XHJ_DPHB", 1));
                base.digitList.Add(new Digit("H", "XHJ_DPH", 1));
                base.digitList.Add(new Digit("占用检查", "XHJ_DPZY", 1));
                base.digitList.Add(new Digit("载频切换", "XHJ_DPZP", 1));
            }
            base.changeStep = 1;
            base.text = "";
            base.sharpType = "sbXHJ";
            this.changeSubType(subType);
        }

        public override void addSize(int r)
        {
        }

        public override void addSize(int d, Point oldPoint, int oldWidth, int oldHeight, int width, int height)
        {
        }

        public override bool changeSubType(string newSubType)
        {
            if (!(((("0".Equals(newSubType) || "2".Equals(newSubType)) || ("1".Equals(newSubType) || "3".Equals(newSubType))) || (("4".Equals(newSubType) || "5".Equals(newSubType)) || ("6".Equals(newSubType) || "7".Equals(newSubType)))) || "8".Equals(newSubType)))
            {
                return false;
            }
            if (((newSubType.Equals("4") || newSubType.Equals("5")) || newSubType.Equals("6")) || newSubType.Equals("7"))
            {
                int num1 = base.direction % 4;
                base.sizeDefine = new Size(3, 3);
            }
            else
            {
                int num2 = base.direction % 4;
                base.sizeDefine = new Size(2, 2);
            }
            base.subType = newSubType;
            this.resetSize();
            return true;
        }

        public override void checkLine(int[][][] array4checkLine)
        {
        }

        public override void createDigit(string kglDesc)
        {
            string[] strArray2;
            string[] strArray = kglDesc.Split(new char[] { ',' });
            Digit digit = null;
            if (!"8".Equals(base.subType))
            {
                strArray2 = strArray[2].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_H");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[3].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_L");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[4].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_U");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[5].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_B");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[6].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_A");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[7].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_2L");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[8].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_2U");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                if (strArray.Length >= 0x10)
                {
                    try
                    {
                        strArray2 = strArray[9].Split(new char[] { ';' });
                        digit = base.getDigit("XHJ_USU");
                        digit.name = strArray2[0];
                        digit.isLogic = "1".Equals(strArray2[1]);
                        digit.ad = int.Parse(strArray2[2]);
                        strArray2 = strArray[10].Split(new char[] { ';' });
                        digit = base.getDigit("XHJ_HS");
                        digit.name = strArray2[0];
                        digit.isLogic = "1".Equals(strArray2[1]);
                        digit.ad = int.Parse(strArray2[2]);
                        strArray2 = strArray[11].Split(new char[] { ';' });
                        digit = base.getDigit("XHJ_BS");
                        digit.name = strArray2[0];
                        digit.isLogic = "1".Equals(strArray2[1]);
                        digit.ad = int.Parse(strArray2[2]);
                        strArray2 = strArray[12].Split(new char[] { ';' });
                        digit = base.getDigit("XHJ_LS");
                        digit.name = strArray2[0];
                        digit.isLogic = "1".Equals(strArray2[1]);
                        digit.ad = int.Parse(strArray2[2]);
                        strArray2 = strArray[13].Split(new char[] { ';' });
                        digit = base.getDigit("XHJ_US");
                        digit.name = strArray2[0];
                        digit.isLogic = "1".Equals(strArray2[1]);
                        digit.ad = int.Parse(strArray2[2]);
                        strArray2 = strArray[14].Split(new char[] { ';' });
                        digit = base.getDigit("XHJ_LU");
                        digit.name = strArray2[0];
                        digit.isLogic = "1".Equals(strArray2[1]);
                        digit.ad = int.Parse(strArray2[2]);
                        strArray2 = strArray[15].Split(new char[] { ';' });
                        digit = base.getDigit("XHJ_HB");
                        digit.name = strArray2[0];
                        digit.isLogic = "1".Equals(strArray2[1]);
                        digit.ad = int.Parse(strArray2[2]);
                        strArray2 = strArray[0x10].Split(new char[] { ';' });
                        digit = base.getDigit("XHJ_GB");
                        digit.name = strArray2[0];
                        digit.isLogic = "1".Equals(strArray2[1]);
                        digit.ad = int.Parse(strArray2[2]);
                    }
                    catch (Exception)
                    {
                    }
                }
            }
            else if ("8".Equals(base.subType))
            {
                strArray2 = strArray[2].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_QDFX");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[3].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPL6");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[4].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPL5");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[5].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPL4");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[6].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPL3");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[7].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPL2");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[8].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPL");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[9].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPLU");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[10].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPLU2");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[11].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPU");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[12].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPU2");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[13].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPU2S");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[14].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPUU");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[15].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPUUS");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[0x10].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPHU");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[0x11].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPHB");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[0x12].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPH");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[0x13].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPZY");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
                strArray2 = strArray[20].Split(new char[] { ';' });
                digit = base.getDigit("XHJ_DPZP");
                digit.name = strArray2[0];
                digit.isLogic = "1".Equals(strArray2[1]);
                digit.ad = int.Parse(strArray2[2]);
            }
        }

        public override double distance(Point p, Size r)
        {
            double num = Math.Pow((p.X - (((((double)(this.rectReal.Right + this.rectReal.Left)) / 2.0) * r.Width) / 2.0)) / 2.0, 2.0);
            double num2 = Math.Pow((p.Y - (((((double)(this.rectReal.Bottom + this.rectReal.Top)) / 2.0) * r.Height) / 2.0)) / 2.0, 2.0);
            int direction = base.direction;
            return (Math.Sqrt(num + num2) / 8.0);
        }

        public override void draw(Graphics g, MapSet ct, Pen usePen)
        {
            if (base.inShowArea())
            {
                this.resetSize();
                Rectangle layoutRectangle = new Rectangle(((this.rectReal.Left * ct.gridsize.Width) / 2) + ct.offset.X, ((this.rectReal.Top * ct.gridsize.Height) / 2) + ct.offset.Y, Sharp.txtAreaSize.Width * ct.gridsize.Width, Sharp.txtAreaSize.Height * ct.gridsize.Width);
                StringFormat format = new StringFormat(StringFormatFlags.NoClip)
                {
                    Alignment = StringAlignment.Center,
                    LineAlignment = StringAlignment.Center
                };
                base.linePen.Color = base.lineColor;
                base.linePen.Width = ct.lineWidth;
                Pen pen = (usePen != null) ? usePen : base.linePen;
                pen.Width = (ct.gridsize.Width >= 8) ? (pen.Width > 2f ? 2f : pen.Width) : 0f;
                pen.Color = (ct.gridsize.Width >= 6) ? pen.Color : Color.Black;
                pen.Color = (base.text.Length > 0) ? pen.Color : Color.Yellow;
                if (MapData.开始打印)
                {
                    pen = new Pen(Color.Black, pen.Width);
                }
                if ("8".Equals(base.subType))
                {
                    Point[] pointArray2;
                    format.Alignment = StringAlignment.Near;
                    format.LineAlignment = StringAlignment.Near;
                    layoutRectangle.Offset(0, ct.gridsize.Height * 2);
                    pen.Color = Color.Green;
                    pen.Width = 1f;
                    this.pointx.X = base.pointX;
                    this.pointx.Y = base.pointY + 1;
                    Point[] points = null;
                    if (2 == base.direction)
                    {
                        pointArray2 = new Point[] { base.grid2pix(new Point(base.pointX + 2, base.pointY), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 2, base.pointY + 2), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 2, base.pointY), ct.gridsize, ct.offset) };
                        points = pointArray2;
                    }
                    else
                    {
                        pointArray2 = new Point[] { base.grid2pix(new Point(base.pointX, base.pointY), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX, base.pointY + 2), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 2, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX, base.pointY), ct.gridsize, ct.offset) };
                        points = pointArray2;
                    }
                    g.DrawLines(pen, points);
                    if (base.text.Length > 0)
                    {
                        g.FillPolygon(Brushes.Green, points);
                    }
                    else
                    {
                        g.FillPolygon(Brushes.Yellow, points);
                    }
                }
                else if (0 == base.direction)
                {
                    format.Alignment = StringAlignment.Near;
                    format.LineAlignment = StringAlignment.Far;
                    if (base.subType.Equals("0") || base.subType.Equals("2"))
                    {
                        this.pointx.X = base.pointX + 1;
                        this.pointx.Y = base.pointY + 2;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 2), ct.gridsize, ct.offset));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 1.0) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 1.1) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = layoutRectangle.Left - 3;
                        layoutRectangle.Y = layoutRectangle.Top - layoutRectangle.Height;
                    }
                    if (base.subType.Equals("1") || base.subType.Equals("3"))
                    {
                        this.pointx.X = base.pointX + 1;
                        this.pointx.Y = base.pointY + 2;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 2), ct.gridsize, ct.offset));
                        g.DrawLine(pen, new Point(((int)(((base.pointX * 1.0) + 1.0) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 1.5) * ct.gridsize.Height)) + ct.offset.Y), new Point(((int)(((base.pointX * 1.0) + 1.4) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 1.5) * ct.gridsize.Height)) + ct.offset.Y));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 1.4) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 1.1) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = layoutRectangle.Left - 3;
                        layoutRectangle.Y = layoutRectangle.Top - layoutRectangle.Height;
                    }
                    if (base.subType.Equals("4"))
                    {
                        this.pointx.X = base.pointX + 1;
                        this.pointx.Y = base.pointY + 3;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 1, base.pointY + 2), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 3), ct.gridsize, ct.offset));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 1.0) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 2.1) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 1.8) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 2.1) * ct.gridsize.Height) + ct.offset.Y), (float)(ct.gridsize.Width * 0.8), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = layoutRectangle.Left - 3;
                        layoutRectangle.Y = layoutRectangle.Top - layoutRectangle.Height;
                    }
                    if ((base.subType.Equals("5") || base.subType.Equals("6")) || base.subType.Equals("7"))
                    {
                        this.pointx.X = base.pointX + 1;
                        this.pointx.Y = base.pointY + 3;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 1, base.pointY + 2), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 3), ct.gridsize, ct.offset));
                        g.DrawLine(pen, new Point(((int)(((base.pointX * 1.0) + 1.0) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 2.5) * ct.gridsize.Height)) + ct.offset.Y), new Point(((int)(((base.pointX * 1.0) + 1.4) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 2.5) * ct.gridsize.Height)) + ct.offset.Y));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 1.4) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 2.1) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 2.2) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 2.1) * ct.gridsize.Height) + ct.offset.Y), (float)(ct.gridsize.Width * 0.8), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = layoutRectangle.Left - 3;
                        layoutRectangle.Y = layoutRectangle.Top - layoutRectangle.Height;
                    }
                }
                else if (1 == base.direction)
                {
                    this.pointx.X = base.pointX;
                    this.pointx.Y = base.pointY + 1;
                    format.Alignment = StringAlignment.Near;
                    format.LineAlignment = StringAlignment.Near;
                    if (base.subType.Equals("0") || base.subType.Equals("2"))
                    {
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 1.0) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = (layoutRectangle.Left + ct.gridsize.Width) + 3;
                        layoutRectangle.Y = layoutRectangle.Top + 2;
                    }
                    if (base.subType.Equals("1") || base.subType.Equals("3"))
                    {
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawLine(pen, new Point(((int)(((base.pointX * 1.0) + 0.5) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 1.0) * ct.gridsize.Height)) + ct.offset.Y), new Point(((int)(((base.pointX * 1.0) + 0.5) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 1.4) * ct.gridsize.Height)) + ct.offset.Y));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 1.4) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = (layoutRectangle.Left + ct.gridsize.Width) + 3;
                        layoutRectangle.Y = layoutRectangle.Top + 2;
                    }
                    if (base.subType.Equals("4"))
                    {
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 1.0) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 1.8) * ct.gridsize.Height) + ct.offset.Y), (float)(ct.gridsize.Width * 0.8), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = (layoutRectangle.Left + ct.gridsize.Width) + 3;
                        layoutRectangle.Y = layoutRectangle.Top + 2;
                    }
                    if ((base.subType.Equals("5") || base.subType.Equals("6")) || base.subType.Equals("7"))
                    {
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawLine(pen, new Point(((int)(((base.pointX * 1.0) + 0.5) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 1.0) * ct.gridsize.Height)) + ct.offset.Y), new Point(((int)(((base.pointX * 1.0) + 0.5) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 1.4) * ct.gridsize.Height)) + ct.offset.Y));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 1.4) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 2.2) * ct.gridsize.Height) + ct.offset.Y), (float)(ct.gridsize.Width * 0.8), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = (layoutRectangle.Left + ct.gridsize.Width) + 3;
                        layoutRectangle.Y = layoutRectangle.Top + 2;
                    }
                }
                else if (2 == base.direction)
                {
                    format.Alignment = StringAlignment.Near;
                    format.LineAlignment = StringAlignment.Near;
                    if (base.subType.Equals("0") || base.subType.Equals("2"))
                    {
                        this.pointx.X = base.pointX + 1;
                        this.pointx.Y = base.pointY;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 1, base.pointY), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.2) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 0.1) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        int width = ct.gridsize.Width;
                        layoutRectangle.X = layoutRectangle.Left + 4;
                        layoutRectangle.Y = layoutRectangle.Top + ct.gridsize.Height;
                    }
                    if (base.subType.Equals("1") || base.subType.Equals("3"))
                    {
                        this.pointx.X = base.pointX + 1;
                        this.pointx.Y = base.pointY;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 1, base.pointY), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawLine(pen, new Point(((int)(((base.pointX * 1.0) + 1.0) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 0.5) * ct.gridsize.Height)) + ct.offset.Y), new Point(((int)(((base.pointX * 1.0) + 0.6) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 0.5) * ct.gridsize.Height)) + ct.offset.Y));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) - 0.2) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 0.1) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        int num2 = ct.gridsize.Width;
                        layoutRectangle.X = layoutRectangle.Left + 4;
                        layoutRectangle.Y = layoutRectangle.Top + ct.gridsize.Height;
                    }
                    if (base.subType.Equals("4"))
                    {
                        this.pointx.X = base.pointX + 2;
                        this.pointx.Y = base.pointY;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 2, base.pointY), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 2, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 1.2) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 0.1) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.4) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 0.1) * ct.gridsize.Height) + ct.offset.Y), (float)(ct.gridsize.Width * 0.8), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = (layoutRectangle.Left + (ct.gridsize.Width / 2)) + 4;
                        layoutRectangle.Y = layoutRectangle.Top + ct.gridsize.Height;
                    }
                    if ((base.subType.Equals("5") || base.subType.Equals("6")) || base.subType.Equals("7"))
                    {
                        this.pointx.X = base.pointX + 2;
                        this.pointx.Y = base.pointY;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 2, base.pointY), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 2, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawLine(pen, new Point(((int)(((base.pointX * 1.0) + 2.0) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 0.5) * ct.gridsize.Height)) + ct.offset.Y), new Point(((int)(((base.pointX * 1.0) + 1.6) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 0.5) * ct.gridsize.Height)) + ct.offset.Y));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.8) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 0.1) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 0.0) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 0.1) * ct.gridsize.Height) + ct.offset.Y), (float)(ct.gridsize.Width * 0.8), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = (layoutRectangle.Left + (ct.gridsize.Width / 2)) + 4;
                        layoutRectangle.Y = layoutRectangle.Top + ct.gridsize.Height;
                    }
                }
                else if (3 == base.direction)
                {
                    format.Alignment = StringAlignment.Near;
                    format.LineAlignment = StringAlignment.Near;
                    if (base.subType.Equals("0") || base.subType.Equals("2"))
                    {
                        this.pointx.X = base.pointX + 2;
                        this.pointx.Y = base.pointY + 1;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 2, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 1.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 0.2) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = layoutRectangle.Left - layoutRectangle.Width;
                        layoutRectangle.Y = layoutRectangle.Top + ((int)(ct.gridsize.Height * 0.2));
                        format.Alignment = StringAlignment.Far;
                    }
                    if (base.subType.Equals("1") || base.subType.Equals("3"))
                    {
                        this.pointx.X = base.pointX + 2;
                        this.pointx.Y = base.pointY + 1;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 1, base.pointY + 1), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 2, base.pointY + 1), ct.gridsize, ct.offset));
                        g.DrawLine(pen, new Point(((int)(((base.pointX * 1.0) + 1.5) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 1.0) * ct.gridsize.Height)) + ct.offset.Y), new Point(((int)(((base.pointX * 1.0) + 1.5) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 0.6) * ct.gridsize.Height)) + ct.offset.Y));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 1.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) - 0.2) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = layoutRectangle.Left - layoutRectangle.Width;
                        layoutRectangle.Y = layoutRectangle.Top + ((int)(ct.gridsize.Height * 0.5));
                        format.Alignment = StringAlignment.Far;
                    }
                    if (base.subType.Equals("4"))
                    {
                        this.pointx.X = base.pointX + 3;
                        this.pointx.Y = base.pointY + 2;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 2, base.pointY + 2), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 3, base.pointY + 2), ct.gridsize, ct.offset));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 2.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 1.2) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 2.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 0.4) * ct.gridsize.Height) + ct.offset.Y), (float)(ct.gridsize.Width * 0.8), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = layoutRectangle.Left - layoutRectangle.Width;
                        layoutRectangle.Y = layoutRectangle.Top + ct.gridsize.Height;
                        format.Alignment = StringAlignment.Far;
                    }
                    if ((base.subType.Equals("5") || base.subType.Equals("6")) || base.subType.Equals("7"))
                    {
                        this.pointx.X = base.pointX + 3;
                        this.pointx.Y = base.pointY + 2;
                        g.DrawLine(pen, base.grid2pix(new Point(base.pointX + 2, base.pointY + 2), ct.gridsize, ct.offset), base.grid2pix(new Point(base.pointX + 3, base.pointY + 2), ct.gridsize, ct.offset));
                        g.DrawLine(pen, new Point(((int)(((base.pointX * 1.0) + 2.5) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 2.0) * ct.gridsize.Height)) + ct.offset.Y), new Point(((int)(((base.pointX * 1.0) + 2.5) * ct.gridsize.Width)) + ct.offset.X, ((int)(((base.pointY * 1.0) + 1.6) * ct.gridsize.Height)) + ct.offset.Y));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 2.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) + 0.8) * ct.gridsize.Height) + ct.offset.Y), (float)((ct.gridsize.Width * 2) * 0.4), (float)(ct.gridsize.Height * 0.8));
                        g.DrawEllipse(pen, (float)((((base.pointX * 1.0) + 2.1) * ct.gridsize.Width) + ct.offset.X), (float)((((base.pointY * 1.0) - 0.0) * ct.gridsize.Height) + ct.offset.Y), (float)(ct.gridsize.Width * 0.8), (float)(ct.gridsize.Height * 0.8));
                        layoutRectangle.X = layoutRectangle.Left - layoutRectangle.Width;
                        layoutRectangle.Y = layoutRectangle.Top + ct.gridsize.Height;
                        format.Alignment = StringAlignment.Far;
                    }
                }
                if (!(base.isHideTxt || (((int)(base.txtSize * ((ct.gridsize.Width * 1.0) / 10.0))) < 4)))
                {
                    g.DrawString(base.text, new Font(base.txtFont, (float)((int)(base.txtSize * ((ct.gridsize.Width * 1.0) / 10.0))), FontStyle.Regular), new SolidBrush(MapData.开始打印 ? Color.Black : base.txtColor), layoutRectangle, format);
                }
                //if (ct.gridsize.Width > 2)
                //{
                //    g.DrawEllipse(new Pen(Color.LightSkyBlue), new Rectangle(base.grid2pix(this.pointx, ct.gridsize, ct.offset) + new Size(-2, -2), new Size(4, 4)));
                //}
            }
        }

        public override Point getPoint(char c)
        {
            return this.pointx;
        }

        public override Point getPoint(char c, out int 方向)
        {
            switch (base.direction)
            {
                case 0:
                    this.i角度 = 180;
                    break;

                case 1:
                    this.i角度 = 90;
                    break;

                case 2:
                    this.i角度 = 0;
                    break;

                case 3:
                    this.i角度 = 270;
                    break;
            }
            方向 = this.i角度;
            return this.pointx;
        }

        public override bool hasHotPoint(int d)
        {
            return false;
        }

        public override bool hasPoint(Point pt)
        {
            return pt.Equals(this.pointx);
        }

        public override void onSpaceChar()
        {
            if (base.subType.Equals("8"))
            {
                base.direction = (base.direction + base.changeStep) % 3;
                if (base.direction != 0)
                {
                    base.direction = 2;
                }
            }
            else
            {
                base.direction = (base.direction + base.changeStep) % 4;
            }
            if (((base.subType.Equals("4") || base.subType.Equals("5")) || base.subType.Equals("6")) || base.subType.Equals("7"))
            {
                switch (base.direction)
                {
                    case 0:
                        base.pointX++;
                        base.pointY--;
                        break;

                    case 1:
                        base.pointX = base.pointX;
                        base.pointY++;
                        break;

                    case 2:
                        base.pointX = base.pointX;
                        base.pointY = base.pointY;
                        break;

                    case 3:
                        base.pointX--;
                        base.pointY = base.pointY;
                        break;
                }
            }
            this.resetSize();
        }

        public override void resetSize()
        {
            this.rectReal.Width = 4;
            this.rectReal.Height = 4;
            this.rectReal.Location = new Point(base.pointX * 2, base.pointY * 2);
            if (0 == base.direction || 4 == base.direction)
            {
                this.rectReal.Location = new Point((base.pointX * 2) + 2, (base.pointY * 2) + 4);
            }
            else if (1 == base.direction || 5 == base.direction)
            {
                this.rectReal.Location = new Point(base.pointX * 2, (base.pointY * 2) + 2);
            }
            else if (2 == base.direction || 6 == base.direction)
            {
                this.rectReal.Location = new Point(base.pointX * 2, base.pointY * 2);
            }
            else if (3 == base.direction || 7 == base.direction)
            {
                this.rectReal.Location = new Point((base.pointX * 2) + 4, base.pointY * 2);
            }
        }

        public override string ToString()
        {
            StringBuilder builder = new StringBuilder("");
            builder.Append(StringUtil.TrimAndPadRight4ASCII(base.text, 1)).Append("信号机");
            switch (int.Parse(base.subType))
            {
                case 0:
                    builder.Append("->调车矮柱:");
                    break;

                case 1:
                    builder.Append("->调车高柱:");
                    break;

                case 2:
                    builder.Append("->出发单灯矮柱:");
                    break;

                case 3:
                    builder.Append("->出发单灯高柱:");
                    break;

                case 4:
                    builder.Append("->出发双灯矮柱:");
                    break;

                case 5:
                    builder.Append("->出发双灯高柱:");
                    break;

                case 6:
                    builder.Append("->进站:");
                    break;

                case 7:
                    builder.Append("->区间:");
                    break;

                case 8:
                    builder.Append("->低频信号:");
                    break;
            }
            builder.Append(" 坐标(").Append(base.pointX).Append(',').Append(base.pointY).Append(')');
            return builder.ToString();
        }

        public override string toStringKgl()
        {
            Digit[] digitArray = base.digitList.ToArray();
            StringBuilder builder = new StringBuilder("");
            if (!"8".Equals(base.subType))
            {
                builder.Append(base.text).Append(",").Append(digitArray[0].name).Append(";").Append(digitArray[0].isLogic ? "1" : "0").Append(";").Append(digitArray[0].ad).Append(",").Append(digitArray[1].name).Append(";").Append(digitArray[1].isLogic ? "1" : "0").Append(";").Append(digitArray[1].ad).Append(",").Append(digitArray[2].name).Append(";").Append(digitArray[2].isLogic ? "1" : "0").Append(";").Append(digitArray[2].ad).Append(",").Append(digitArray[3].name).Append(";").Append(digitArray[3].isLogic ? "1" : "0").Append(";").Append(digitArray[3].ad).Append(",").Append(digitArray[4].name).Append(";").Append(digitArray[4].isLogic ? "1" : "0").Append(";").Append(digitArray[4].ad).Append(",").Append(digitArray[5].name).Append(";").Append(digitArray[5].isLogic ? "1" : "0").Append(";").Append(digitArray[5].ad).Append(",").Append(digitArray[6].name).Append(";").Append(digitArray[6].isLogic ? "1" : "0").Append(";").Append(digitArray[6].ad).Append(",").Append(digitArray[7].name).Append(";").Append(digitArray[7].isLogic ? "1" : "0").Append(";").Append(digitArray[7].ad).Append(",").Append(digitArray[8].name).Append(";").Append(digitArray[8].isLogic ? "1" : "0").Append(";").Append(digitArray[8].ad).Append(",").Append(digitArray[9].name).Append(";").Append(digitArray[9].isLogic ? "1" : "0").Append(";").Append(digitArray[9].ad).Append(",").Append(digitArray[10].name).Append(";").Append(digitArray[10].isLogic ? "1" : "0").Append(";").Append(digitArray[10].ad).Append(",").Append(digitArray[11].name).Append(";").Append(digitArray[11].isLogic ? "1" : "0").Append(";").Append(digitArray[11].ad).Append(",").Append(digitArray[12].name).Append(";").Append(digitArray[12].isLogic ? "1" : "0").Append(";").Append(digitArray[12].ad).Append(",").Append(digitArray[13].name).Append(";").Append(digitArray[13].isLogic ? "1" : "0").Append(";").Append(digitArray[13].ad).Append(",").Append(digitArray[14].name).Append(";").Append(digitArray[14].isLogic ? "1" : "0").Append(";").Append(digitArray[14].ad).Append(",;0;65535,;0;65535,;0;65535,;0;65535");
            }
            else
            {
                builder.Append(base.text).Append(",").Append(digitArray[0].name).Append(";").Append(digitArray[0].isLogic ? "1" : "0").Append(";").Append(digitArray[0].ad).Append(",").Append(digitArray[1].name).Append(";").Append(digitArray[1].isLogic ? "1" : "0").Append(";").Append(digitArray[1].ad).Append(",").Append(digitArray[2].name).Append(";").Append(digitArray[2].isLogic ? "1" : "0").Append(";").Append(digitArray[2].ad).Append(",").Append(digitArray[3].name).Append(";").Append(digitArray[3].isLogic ? "1" : "0").Append(";").Append(digitArray[3].ad).Append(",").Append(digitArray[4].name).Append(";").Append(digitArray[4].isLogic ? "1" : "0").Append(";").Append(digitArray[4].ad).Append(",").Append(digitArray[5].name).Append(";").Append(digitArray[5].isLogic ? "1" : "0").Append(";").Append(digitArray[5].ad).Append(",").Append(digitArray[6].name).Append(";").Append(digitArray[6].isLogic ? "1" : "0").Append(";").Append(digitArray[6].ad).Append(",").Append(digitArray[7].name).Append(";").Append(digitArray[7].isLogic ? "1" : "0").Append(";").Append(digitArray[7].ad).Append(",").Append(digitArray[8].name).Append(";").Append(digitArray[8].isLogic ? "1" : "0").Append(";").Append(digitArray[8].ad).Append(",").Append(digitArray[9].name).Append(";").Append(digitArray[9].isLogic ? "1" : "0").Append(";").Append(digitArray[9].ad).Append(",").Append(digitArray[10].name).Append(";").Append(digitArray[10].isLogic ? "1" : "0").Append(";").Append(digitArray[10].ad).Append(",").Append(digitArray[11].name).Append(";").Append(digitArray[11].isLogic ? "1" : "0").Append(";").Append(digitArray[11].ad).Append(",").Append(digitArray[12].name).Append(";").Append(digitArray[12].isLogic ? "1" : "0").Append(";").Append(digitArray[12].ad).Append(",").Append(digitArray[13].name).Append(";").Append(digitArray[13].isLogic ? "1" : "0").Append(";").Append(digitArray[13].ad).Append(",").Append(digitArray[14].name).Append(";").Append(digitArray[14].isLogic ? "1" : "0").Append(";").Append(digitArray[14].ad).Append(",").Append(digitArray[15].name).Append(";").Append(digitArray[15].isLogic ? "1" : "0").Append(";").Append(digitArray[15].ad).Append(",").Append(digitArray[0x10].name).Append(";").Append(digitArray[0x10].isLogic ? "1" : "0").Append(";").Append(digitArray[0x10].ad).Append(",").Append(digitArray[0x11].name).Append(";").Append(digitArray[0x11].isLogic ? "1" : "0").Append(";").Append(digitArray[0x11].ad).Append(",").Append(digitArray[0x12].name).Append(";").Append(digitArray[0x12].isLogic ? "1" : "0").Append(";").Append(digitArray[0x12].ad);
            }
            return builder.ToString();
        }

        public override string toStringXiangshu()
        {
            return string.Concat(new object[] { 
                base.text, ",", base.sharpType, ",", base.subType, ",", (base.lineColor.R + (base.lineColor.G << 8)) + (base.lineColor.B << 0x10), ",", base.direction, ",", base.pointX, ",", base.pointY, ",", base.sizeDefineWidth, ",", 
                base.sizeDefineHeight, ",", base.txtSize, ",", ((base.txtColor.B << 0x10) + (base.txtColor.G << 8)) + base.txtColor.R, ",", base.txtFont.Trim(), ",", base.isHideTxt ? "1" : "0"
             });
        }

        public override void xuanzhuan180(Point center)
        {
            base.xuanzhuan180(center);
            if (!base.subType.Equals("8"))
            {
                switch (base.direction)
                {
                    case 0:
                    case 2:
                        base.direction = 2 - base.direction;
                        break;

                    case 1:
                        base.direction = 3;
                        break;

                    case 3:
                        base.direction = 1;
                        break;
                }
            }
            if (((base.subType.Equals("0") || base.subType.Equals("1")) || base.subType.Equals("2")) || base.subType.Equals("3"))
            {
                base.pointX -= 2;
                base.pointY -= 2;
            }
            else if (((base.subType.Equals("4") || base.subType.Equals("5")) || base.subType.Equals("6")) || base.subType.Equals("7"))
            {
                base.pointX -= 3;
                base.pointY -= 3;
            }
            else if (base.subType.Equals("8"))
            {
                base.pointX -= 4;
                base.pointY -= 4;
            }
        }
    }
}

